<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="content-type" content="text/html; charset=Shift_JIS" />
<head>
<title>xml paser | example</title>
<script charset="utf-8" type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="../gmap3util.js"></script>
<script type="text/javascript">
google.maps.event.addDomListener(window, 'load', function () {
	/* block id name */
	var block  = "mapbox";
	/* XMLファイルパス */
	var xmlUri = "xml/sample.xml";
	/* マーカーオブジェクト */
	var markers = [];

	// GoogleMap初期化
	initializeMap(block, {
		zoom      : 13,
		center    : new google.maps.LatLng(34.686918, 135.839253),
		mapTypeId : google.maps.MapTypeId.ROADMAP
	});
	// ファイル取得
	requestUri(xmlUri, function (data, map) {
		var point = data.getElementsByTagName("point");
		for (var i = 0; i < point.length; i++) {
			var title  = point[i].getAttribute("title").toString();
			var marker = new google.maps.Marker({
				map      : map,
				title    : title,
				position : new google.maps.LatLng(
					parseFloat(point[i].getAttribute("lat")),
					parseFloat(point[i].getAttribute("lng"))
				),
				icon     : new google.maps.MarkerImage(
					"images/orange.png",
					new google.maps.Size(32, 32),
					new google.maps.Point(0,0),
					new google.maps.Point(16, 32)
				)
			});
			addMarker(marker, {
				infowindow : new google.maps.InfoWindow({
					content: title,
					zindex : i
				}),
				windowid  : i
			});
			google.maps.event.addListener(marker, "click", function () {
				clearInfoWindows("infowindow");
				this._op.infowindow.open(map, this);
			});
		}
	});
});
</script>
</head>
<body>
	<div id="mapbox" style="width : 800px; height : 600px;"></div>
</body>
</html>